//
//  ERCountryListTableViewCell.m
//  ExchangeRate
//
//  Created by lanou on 15/11/7.
//  Copyright © 2015年 方义强. All rights reserved.
//

#import "ERCountryListTableViewCell.h"

@implementation ERCountryListTableViewCell
- (void)setNameStr:(NSString *)nameStr
{
    _nameStr = nameStr;
    _countryNameLabel.text = nameStr;
}

- (void)setConfigureModel:(ERResourceModel *)configureModel
{
    _configureModel = configureModel;
    _selectMarkLabel.text = nil;
    if (configureModel.fields.isSelected == 1) {
        _selectMarkLabel.text = NSLocalizedString(@"已选择", nil);
    }
    if (configureModel.isEdit != 0) {
        _selectMarkLabel.text = NSLocalizedString(@"当前选择", nil);
    }
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.backgroundColor = [UIColor clearColor];
        _countryNameLabel = [[UILabel alloc] initWithFrame:CGRectMake(25, 10, kSCREENWIDTH / 3 * 2, 30)];
        _countryNameLabel.font = [UIFont fontWithName:@"STHeitik-Light" size:16];
        _countryNameLabel.textColor = [UIColor whiteColor];
        _countryNameLabel.textAlignment = NSTextAlignmentLeft;
        _countryNameLabel.backgroundColor = [UIColor clearColor];
        [self.contentView addSubview:_countryNameLabel];
        
        _selectMarkLabel = [[UILabel alloc] initWithFrame:CGRectMake(kSCREENWIDTH - 120, 15, 100, 20)];
        _selectMarkLabel.font = [UIFont systemFontOfSize:13];
        _selectMarkLabel.textAlignment = NSTextAlignmentRight;
        _selectMarkLabel.textColor = [UIColor lightGrayColor];
        _selectMarkLabel.backgroundColor = [UIColor clearColor];
        [self.contentView addSubview:_selectMarkLabel];
    }
    return self;
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
